package com.benson.effective.clone;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class CloneObject implements Cloneable{

	private final int value ;

	public CloneObject(int value){
		this.value = value;
	}
	public int getValue() {
		return value;
	}
	
	public static void main(String[] args) throws CloneNotSupportedException {
		THINGS.add(2);
		System.out.println(VALUES.size());
		THINGS.add(5);
		System.out.println(VALUES.size()+":"+VALUES.toString());//
//		VALUES.add(3);
		Object o = new Object();
		Byte b = 0;
		System.out.println(b);
	}

	
	@Override
	public CloneObject clone() throws CloneNotSupportedException {
		return (CloneObject)super.clone();
	}

	@Override
	public String toString() {
		return String.format("values:%d", value);
	}
	
	private static final List<Integer> THINGS = new ArrayList<Integer>();
	public static final List<Integer> VALUES = Collections.unmodifiableList(THINGS);

	
	public List<Integer> get2(){
		return Collections.unmodifiableList(THINGS);
	}
	
}
